package spec.ocl_mcg;

import graph.mcg.CGNode;

import org.eclipse.ocl.ecore.IteratorExp;
import org.eclipse.ocl.ecore.Variable;


public class IteratorExpNode extends TreeNode {
	private TreeNode source;
	private TreeNode body;
	private VariableNode iterator;
	private String operation;

	public IteratorExpNode(){}
	
	public IteratorExpNode(IteratorExp exp){
		iterator = (VariableNode) exp.getIterator();
		operation = exp.getName();
	}
	
	public TreeNode getSource() {
		return source;
	}

	public void setSource(TreeNode source) {
		this.source = source;
	}

	public TreeNode getBody() {
		return body;
	}

	public void setBody(TreeNode body) {
		this.body = body;
	}

	public VariableNode getIterator() {
		return iterator;
	}

	public void setIterator(VariableNode iterator) {
		this.iterator = iterator;
	}

	public String getOperation() {
		return operation;
	}

	public void setOperation(String operation) {
		this.operation = operation;
	}

	@Override
	public CGNode toCG() {
		// TODO Auto-generated method stub
		IterativeNode cfgnode = new IterativeNode(this);
		
		return cfgnode;
	}

	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return null;
	}

}
